package com.sirui.x.learnIo.serializ;

import java.nio.charset.Charset;

public class SerializUnicode {
    public static String deserialization(byte[] bytes) {
		// utf-8
		return new String(bytes, Charset.forName("UTF-8"));
	}
	
	public static String deserialization(byte[] bytes, int offset, int len) {
		// utf-8
		return new String(bytes, offset, len, Charset.forName("UTF-8"));
	}
	
	public static byte[] serialization(String msg) {
		// utf-8
		return msg.getBytes(Charset.forName("UTF-8"));
	}
}
